import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store';
import './assets/css/reset.css';
import './assets/css/common.css';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import goDetail from './mixin/index';
import axios from "axios";

axios.defaults.baseURL = "http://124.71.68.3:7001";
Vue.prototype.$http = axios
Vue.mixin(goDetail)
Vue.use(ElementUI);
Vue.config.productionTip = false

// 路由更新导致跳转时会抛出错误
import Router from 'vue-router'
const originalPush = Router.prototype.push
Router.prototype.push = function push(location, onResolve, onReject) {
  if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
  return originalPush.call(this, location).catch(err => err)
}

new Vue({
  router,
  store,
  beforeCreate(){
    Vue.prototype.$bus = this
  },
  render: h => h(App)
}).$mount('#app')
